<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <title>订单详情</title>
    <link th:href="@{/css/index.css}" rel="stylesheet"/>
    <link rel="stylesheet" th:href="@{css/orderDoList.css}"> <!-- 引入你的CSS文件 -->
</head>
<body>
<th:block th:insert="~{header :: head}"/>
<div class="container">
    <h1>订单详情</h1>

    <!-- 单个订单框 -->
    <div th:each="order : ${orders}" class="order-box">
        <form action="createOrder" method="POST">
            <input type="hidden" name="orderid" th:value="${order.getOrderid()}">
            <input type="hidden" name="concertid" th:value="${order.concertid}">
            <input type="hidden" name="ticketid" th:value="${order.getTicketid()}">

            <div class="order-summary">
                <p>订单编号：<strong th:text="${order.getOrderid()}"></strong></p>
                <p>演唱会：<strong th:text="${order.concert.getConcertname()}"></strong></p>
                <p>时间：<strong th:text="${#dates.format(order.concert.concertdate, 'yyyy-MM-dd')}"></strong></p>
                <p>地点：<strong th:text="${order.concert.venue}"></strong></p>
                <p>票档：<strong th:text="${order.ticket.getTickettype()}"></strong></p>
                <p>座位：<strong th:text="${order.seat.getSeatarea()} + ${order.seat.getSeatnumber()}"></strong></p>
                <p>总价：<strong th:text="${order.ticket.getPrice()}"></strong> 元</p>
                <p th:if="${order.getOrdertime()} != null">下单时间：<strong th:text="${#dates.format(order.getOrdertime(), 'yyyy-MM-dd HH:mm:ss')}"></strong></p>
                <p th:if="${order.getPaymenttime()} != null">支付时间：<strong th:text="${#dates.format(order.getPaymenttime(), 'yyyy-MM-dd HH:mm:ss')}"></strong></p>
            </div>

            <div class="payment-status">
                <p>支付状态：<strong th:text="${order.getOrderstatus() == 0 ? '未支付' : '已支付'}"></strong></p>
            </div>

            <!-- 用户操作按钮区域 -->
            <div class="user-actions">
                <a href="index" class="back-button">返回首页</a>
                <a th:if="${order.getOrderstatus() == 1}" href="orderList" class="orders-button">查看我的订单</a>
                <button th:if="${order.getOrderstatus() == 0}" class="orders-button">去支付</button>
            </div>
        </form>
    </div>
</div>
<th:block th:insert="~{footer :: foot}"/>
</body>
</html>
